import { lazy } from "react";
import {createBrowserRouter,Navigate} from 'react-router-dom'
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
    TeamOutlined,
    UserOutlined,
  } from '@ant-design/icons';
// 一级路由
import Login from "../page/Login";
import Zhu from "../page/Zhu";
// 二级路由
import Home from "../page/Home";
import List from "../page/List";
import My from "../page/My";
// 三级路由
import Xq from "../page/Xq";


// 二级路由
export const menu_router=[
    {
        path:"/zhu/home",
        element:<Home></Home>,
        title:"首页",
        icon:<DesktopOutlined></DesktopOutlined>
    },
    {
        path:"/zhu/list",
        element:<List></List>,
        title:"图标也",
        icon:<PieChartOutlined></PieChartOutlined>
    },
    {
        path:"/zhu/my",
        element:<My></My>,
        title:"商家",
        icon:<PieChartOutlined></PieChartOutlined>,
        // 三级路由
        children:[
            {
                path:"/zhu/my/xq",
                element:<Xq></Xq>,
                title:"三级路由"
            }
        ]
    }
]
const  routes=createBrowserRouter([
    {
        path:"/",
        element:<Navigate to={'/zhu'}></Navigate>
    },
    {
        path:"/zhu",
        element:<Zhu></Zhu>,
        children:menu_router
    },
    {
        path:"/login",
        element:<Login></Login>
    }
])


export default routes